Colin Walters [Fri, 26 Jul 2013 23:25:07 +0000 (19:25 -0400)]
Install a shared library
This required a fair bit of surgery because previously ostree.h
included otutil.h, but that's supposed to be a private library.
Colin Walters [Fri, 26 Jul 2013 18:48:15 +0000 (14:48 -0400)]
core: Work around libguestfs/FUSE issue with setuid binaries
For some reason, the setuid bits are being stripped. This
workaround is enough for now.
Colin Walters [Thu, 25 Jul 2013 22:52:06 +0000 (18:52 -0400)]
Add API to retrieve statistics from transactions, use it in commit
It's just interesting to see =) This is also kind of prototyping out
some more "structured" output.
Colin Walters [Thu, 25 Jul 2013 21:09:00 +0000 (17:09 -0400)]
lib: Use -export-symbol-regex
Just a small step towards being a better library.
Colin Walters [Thu, 25 Jul 2013 16:06:21 +0000 (12:06 -0400)]
fsck: Fix crash on repositories with < 10 objects
Colin Walters [Wed, 24 Jul 2013 22:20:19 +0000 (18:20 -0400)]
pull: Tweak status line again, do what git does
Almost, we don't have bytes transferred. And we lie about percentages
since as metadata comes in the total number of objects to fetch goes
up.
Colin Walters [Wed, 24 Jul 2013 18:46:53 +0000 (14:46 -0400)]
main: Fix previous commit to find repo in cwd over /ostree/repo
The tests when run inside gnome-ostree broke, and this is better
behavior.
Colin Walters [Wed, 24 Jul 2013 18:05:12 +0000 (14:05 -0400)]
main: Support using repo from current directory
$ cd repo
$ ostree ls foo /
...
Can be a lot more convenient than typing --repo=repo a lot.
Colin Walters [Wed, 24 Jul 2013 17:10:28 +0000 (13:10 -0400)]
TODO: More bits about commit objects
Colin Walters [Wed, 24 Jul 2013 16:59:27 +0000 (12:59 -0400)]
Drop support for related objects and metadata in commit objects
While the actual commit object format is presently the same, for a
number of reasons we'd like to change it fairly radically. Among
other things, we need to drop our a{sv} types in objects, to protect
against GVariant changing format.
Since now gnome-ostree now longer uses related objects, and nothing
ever used metadata, just drop them both.
Colin Walters [Wed, 24 Jul 2013 13:36:51 +0000 (09:36 -0400)]
main: Fix an uninitialized variable
Colin Walters [Tue, 23 Jul 2013 23:36:15 +0000 (19:36 -0400)]
pull: Always scan for commit object, even if ref is unchanged
If the admin encounters corruption and does:
$ ostree admin fsck --delete
We want them to be able to recover the objects easily from the
network; with this patch, they do:
$ ln -s dummyvalue /ostree/repo/transaction
$ ostree refs --delete remotename:branchname
$ ostree pull remotename
This patch avoids the need for the refs --delete; we might as well
force scan the commit, and with this patch we still print that it
changed.
Colin Walters [Tue, 23 Jul 2013 22:41:03 +0000 (18:41 -0400)]
main: ls: Behave like standard Unix "ls" with directories
Default to listing directory contents, add -d/--dironly to suppress
this.
Colin Walters [Tue, 23 Jul 2013 22:34:34 +0000 (18:34 -0400)]
main: Squash a compiler warning
Colin Walters [Tue, 23 Jul 2013 22:33:29 +0000 (18:33 -0400)]
main: Consistently use "opt_" as a prefix for option local variables
This makes it easier to find where we're using global state, which is
useful when refactoring code into libostree.
Colin Walters [Tue, 23 Jul 2013 22:24:52 +0000 (18:24 -0400)]
main: commit: Drop broken --parent option
No idea why we had this, it didn't do anything in the current code.
Noticed while doing other refactoring.
Colin Walters [Tue, 23 Jul 2013 22:16:54 +0000 (18:16 -0400)]
main: Drop log builtin
We may revive this later, but commits in their current form aren't
very useful for humans to read, so it doesn't make sense to have a
tool to show a history of useless stuff.
More interesting things are diffs between commits, object statistics,
etc.
Colin Walters [Tue, 23 Jul 2013 21:29:46 +0000 (17:29 -0400)]
main: pull: Reduce the status line length a bit
Drop "objects" where it's obvious [ to me anyways =) ], and drop the
bytes transferred since our math was off, and the HTTP status kind of
shows that.
Colin Walters [Tue, 23 Jul 2013 18:42:07 +0000 (14:42 -0400)]
TODO: Add an item about commit objets
Colin Walters [Tue, 23 Jul 2013 13:19:24 +0000 (09:19 -0400)]
admin: Add an "undeploy" command
Otherwise it's really easy to keep accumulating deployments. Also, we
may want to run this after rebooting, so we're back down to one
operating system.
Colin Walters [Thu, 18 Jul 2013 18:23:55 +0000 (14:23 -0400)]
core: Don't strip setuid bits when creating files
This ugly regression occurred because I overlooked the fact that our
chown() invocation would strip off setuid.
Colin Walters [Thu, 18 Jul 2013 18:23:12 +0000 (14:23 -0400)]
main: show: Don't strip mode, let's see the whole thing
Just useful for debugging.
Colin Walters [Thu, 18 Jul 2013 16:09:44 +0000 (12:09 -0400)]
main: Add --delete option to fsck
This is useful for clearing out all corrupted objects locally.
Colin Walters [Thu, 18 Jul 2013 13:05:58 +0000 (09:05 -0400)]
main: Clean up fsck code: honor --quiet, warn (but continue) on missing objects
When we make fsck --delete work again, it will be convenient to
continue on missing objects.
Colin Walters [Thu, 18 Jul 2013 03:00:03 +0000 (23:00 -0400)]
Update libgsystem
Colin Walters [Thu, 18 Jul 2013 01:10:04 +0000 (21:10 -0400)]
main: Make "ostree show" actually useful for files
We already have "ostree cat" for files, here we want to see a dump of
the metadata.
Colin Walters [Thu, 18 Jul 2013 00:20:50 +0000 (20:20 -0400)]
TODO: Add more
Colin Walters [Wed, 17 Jul 2013 23:47:40 +0000 (19:47 -0400)]
tests: Add a test for link checkout speedup
Colin Walters [Wed, 17 Jul 2013 23:20:22 +0000 (19:20 -0400)]
diff: Add --stats option
This a neat way to see how many objects are shared between two
commits.
Colin Walters [Wed, 17 Jul 2013 20:16:45 +0000 (16:16 -0400)]
main: Add --link-checkout-speedup option to commit
And disable devino scan by default. For the gnome-ostree build case,
our commits are from "make install DESTDIR=", so they won't be
hardlinks into the repo. In that case, particularly as the repository
size grows, the cost of building up the devino -> checksum mapping
becomes a problem.
The compose step will use this option though.
Jiro Matsuzawa [Wed, 17 Jul 2013 03:20:31 +0000 (12:20 +0900)]
doc: Fix a typo
https://bugzilla.gnome.org/show_bug.cgi?id=704365
Colin Walters [Wed, 17 Jul 2013 00:41:47 +0000 (20:41 -0400)]
Release 2013.4
Colin Walters [Tue, 16 Jul 2013 22:40:11 +0000 (18:40 -0400)]
doc: A long overdue manpage update
Ok, just a little one, but still. I actually updated documentation!
Colin Walters [Tue, 16 Jul 2013 22:13:39 +0000 (18:13 -0400)]
main: Move GCancellable to toplevel
This is just cleaner, and makes the builtins slightly more of a
library, which in turn makes it easier to turn them into real API.
Colin Walters [Tue, 16 Jul 2013 14:01:58 +0000 (10:01 -0400)]
prune: Don't fail if a to-be-pruned object doesn't exist
Previously, if a prune was interrupted, further attempts would fail.
It's just better to silently continue here.
Colin Walters [Tue, 16 Jul 2013 13:35:44 +0000 (09:35 -0400)]
Drop support for fifos and devices
While the first was useful way back in the day when we were importing
Debian bits and /sbin/init was expecting to find /dev/.initctl as a
named pipe, that's no longer an issue with systemd since it uses
dynamic Unix sockets.
Likewise, character and block devices in /dev are now dynamically
created by the devtmpfs from the kernel.
Less complexity and code here if we just support directories, regular
files, and symbolic links.
Colin Walters [Tue, 16 Jul 2013 13:22:42 +0000 (09:22 -0400)]
core: Drop a leftover unnecessary #define _GNU_SOURCE
We now use AC_USE_SYSTEM_EXTENSIONS.
Colin Walters [Tue, 16 Jul 2013 12:50:31 +0000 (08:50 -0400)]
core: Use gsystem API for generating temporary names
Drops duplicated code.
Colin Walters [Tue, 16 Jul 2013 12:49:46 +0000 (08:49 -0400)]
core: Use gs_file_create()
This allows us to drop a chmod() invocation, since the regular file
path was the only thing that didn't handle mode.
Colin Walters [Tue, 16 Jul 2013 12:51:37 +0000 (08:51 -0400)]
Update libgsystem
Colin Walters [Mon, 15 Jul 2013 20:13:12 +0000 (16:13 -0400)]
admin: Rename prune -> cleanup, avoid doing repo prune twice
Calling it "cleanup" is better since it does more than repo pruning.
We were also doing a prune twice; ot_admin_cleanup() already does one,
so drop the bits to do it in cleanup.c.
Colin Walters [Thu, 11 Jul 2013 21:29:04 +0000 (17:29 -0400)]
admin: Initialize sysroot to / by default, not garbage from the stack
Oops.
Colin Walters [Thu, 11 Jul 2013 21:07:14 +0000 (17:07 -0400)]
admin status: Print out origin too
This is useful data.
Colin Walters [Wed, 10 Jul 2013 22:42:58 +0000 (18:42 -0400)]
main: Also make ostree admin foo --help work
A followup for the previous commit.
Colin Walters [Wed, 10 Jul 2013 22:23:52 +0000 (18:23 -0400)]
main: Only parse options in subcommands
This makes e.g. "ostree commit --help" work, which is really good.
Colin Walters [Wed, 10 Jul 2013 22:13:55 +0000 (18:13 -0400)]
main: Don't look for /sysroot/ostree too
No longer necessary now that we expect OS/ trees to have
/ostree -> /sysroot/ostree.
Colin Walters [Wed, 10 Jul 2013 17:24:15 +0000 (13:24 -0400)]
Use AC_USE_SYSTEM_EXTENSIONS instead of #define _GNU_SOURCE
It's less copy/paste, works everywhere, etc.
Also fix some missing #include "config.h".
Colin Walters [Wed, 10 Jul 2013 17:25:15 +0000 (13:25 -0400)]
main: Print "error: " prefix on errors
It's just clearer that something went wrong.
Colin Walters [Wed, 10 Jul 2013 06:30:26 +0000 (02:30 -0400)]
admin: Add a warm fuzzy message to deploy about transactions
Since it sounds cool and stuff.
Colin Walters [Wed, 10 Jul 2013 04:00:11 +0000 (00:00 -0400)]
TODO: Misc updates
Colin Walters [Wed, 10 Jul 2013 00:38:05 +0000 (20:38 -0400)]
Delete leftover kernel update hooks
Colin Walters [Wed, 10 Jul 2013 00:31:55 +0000 (20:31 -0400)]
Build without libsoup again
Colin Walters [Wed, 10 Jul 2013 00:30:00 +0000 (20:30 -0400)]
ostree: Some header file cleanups
Colin Walters [Wed, 10 Jul 2013 00:16:49 +0000 (20:16 -0400)]
cmd: Drop "ostree admin install" and curl fetcher
It isn't useful at the moment, since the deploy stuff all changed. It
will make sense to bring back later, but for now let's not carry
broken untested code.
Colin Walters [Wed, 10 Jul 2013 00:14:53 +0000 (20:14 -0400)]
libostree: Move pull code into here
More library work.
Colin Walters [Wed, 10 Jul 2013 00:05:31 +0000 (20:05 -0400)]
libostree: Move prune into OstreeRepo namespace
More library work.
Colin Walters [Tue, 9 Jul 2013 23:59:39 +0000 (19:59 -0400)]
libostree: Rename ostree-traverse.h into OstreeRepo namespace
This operates on the repo, it might as well be methods on it.
Colin Walters [Tue, 9 Jul 2013 23:49:00 +0000 (19:49 -0400)]
libostree: Split off -refs.c
Continuing to break up ostree-repo.c.
Colin Walters [Tue, 9 Jul 2013 23:11:37 +0000 (19:11 -0400)]
libostree: Split off libarchive code
Colin Walters [Tue, 9 Jul 2013 23:02:38 +0000 (19:02 -0400)]
libostree: Start splitting up the monstrous ostree-repo.c
Checkout now lives in its own file.
Colin Walters [Tue, 9 Jul 2013 22:53:22 +0000 (18:53 -0400)]
Switch to #pragma once for headers
It's just less tedious, and we're GCC/LLVM specific anyways.
Colin Walters [Tue, 9 Jul 2013 22:46:00 +0000 (18:46 -0400)]
pull: Explicitly use thread-default main context
As preparation for pushing our own temporary context.
Colin Walters [Tue, 9 Jul 2013 22:23:55 +0000 (18:23 -0400)]
admin: Use internal pull API instead of subprocess
So we're doing more of the library thing.
Colin Walters [Tue, 9 Jul 2013 22:33:30 +0000 (18:33 -0400)]
pull: Destroy queue watching GSource
When being more of a library, we can't leave garbage attached to the
default main context.
Colin Walters [Tue, 9 Jul 2013 21:56:51 +0000 (17:56 -0400)]
core: Move pull logic into an API
The general trend should be becoming more of a shared library with
command line wrappers.
Colin Walters [Tue, 9 Jul 2013 19:40:20 +0000 (15:40 -0400)]
pull: Add "tls-permissive" config option to disable SSL/TLS certificate checks
Like GIT_SSL_NO_VERIFY=true, available for the same reasons.
Colin Walters [Tue, 9 Jul 2013 19:02:48 +0000 (15:02 -0400)]
pull: Verify SSL/TLS certificates against system CA file by default
We also need a mechanism like GIT_SSL_NO_VERIFY...probably an option
in the config.
Colin Walters [Tue, 9 Jul 2013 16:04:02 +0000 (12:04 -0400)]
prepare-root: Don't be strict about the sysroot mount name here
While the systemd integration effectively requires /sysroot, it will
help people trying to use OSTree with other initramfs systems
(e.g. initramfs-tools) if we don't hardcode that requirement in this
tool.
Colin Walters [Tue, 9 Jul 2013 15:28:49 +0000 (11:28 -0400)]
tests: Add a test of corruption during a pull process
These corruption tests could be a lot better...like randomly try
single bit flips, range flips. Better, content-aware fuzzing. But
this is useful for now.
Colin Walters [Tue, 9 Jul 2013 14:41:07 +0000 (10:41 -0400)]
tests: Drop numeric prefix
Theoretically it's useful to have layers of tests, but in practice
it's just annoying to assign numbers.
Colin Walters [Tue, 9 Jul 2013 13:28:02 +0000 (09:28 -0400)]
Fix test reference to obsolete ostree-pull
It was leftover in my buildroot =/
Colin Walters [Mon, 8 Jul 2013 13:05:34 +0000 (09:05 -0400)]
repo: Store transaction file, use it to optimize for pull resumes
If pull is interrupted, we may have downloaded an arbitrary subset of
the requested objects. Previously, we handled this by scanning for
all objects each time.
However, there's an easy optimization - this patch creates a lock file
in the repo. If we don't see that file when starting a pull, we know
we don't need to stat() every file; presence of a dirtree object for
example implies the existence of everything it references.
Colin Walters [Mon, 8 Jul 2013 01:55:25 +0000 (21:55 -0400)]
Drop obsolete GRUB2 and kernel update hooks
We only support syslinux at the moment; grub2 should learn to parse
the bootloader spec.
Colin Walters [Mon, 8 Jul 2013 00:54:03 +0000 (20:54 -0400)]
Release 2013.3
Colin Walters [Mon, 8 Jul 2013 01:35:15 +0000 (21:35 -0400)]
Add a few more bits to EXTRA_DIST
Colin Walters [Sun, 7 Jul 2013 22:14:53 +0000 (18:14 -0400)]
Remove stub daemon code
This really shouldn't have lived so long...it does nothing now, and we
should probably just be exposing an API for packagekit anyways.
Colin Walters [Sun, 7 Jul 2013 18:37:59 +0000 (14:37 -0400)]
Remove built in "triggers"
Originally, the idea was that clients would replicate "OS/tree"s from
a build server, but we'd run things like "ldconfig" on the client.
This was to allow adding e.g. the nVidia binary driver.
However, the triggers were the only thing in the system at the moment
that really had expected knowledge of the *contents* of the OS, like
the location of binaries.
For now, it's architecturally cleaner if we move the burden of
triggers to the tree builder (e.g. gnome-ostree or RPM). Eventually
we may want OSTree to assist with this type of thing (perhaps
something like RPM %ghost), but this is the right thing to do now.
Colin Walters [Sun, 7 Jul 2013 18:30:01 +0000 (14:30 -0400)]
admin: Fix various compiler warnings
Colin Walters [Sun, 7 Jul 2013 17:45:18 +0000 (13:45 -0400)]
admin: Also delete unsed boot directories
My VM filled up /boot. Oops.
Colin Walters [Sun, 7 Jul 2013 16:42:02 +0000 (12:42 -0400)]
admin: Split up the monstrous ot-admin-functions.c
Now util, cleanup, and functions.
Colin Walters [Sun, 7 Jul 2013 16:27:44 +0000 (12:27 -0400)]
Switch to libgsystem local allocation macros
And drop our compatibility wrapper.
Colin Walters [Sat, 29 Jun 2013 15:45:53 +0000 (11:45 -0400)]
[INCOMPATIBLE CHANGE] Implement new deployment model
See https://wiki.gnome.org/OSTree/DeploymentModel2
This is a major rework of the on-disk filesystem layout, and the boot
process. OSTree now explicitly supports upgrading kernels, and these
upgrades are also atomic.
The core concept of the new model is the "deployment list", which is
an ordered list of bootable operating system trees. The deployment
list is reflected in the bootloader configuration; which has a kernel
argument that tells the initramfs (dracut) which operating system root
to use.
Invidiual notable changes that come along with this:
1) Operating systems should now come with their etc in usr/etc; OSTree
will perform a 3-way merge at deployment time, and place etc in
the actual root. This avoids the need for a bind mount, and is
just a lot cleaner.
2) OSTree no longer bind mounts /root, /home, and /tmp. It is expected
that the the OS/ has these as symbolic links into /var.
At the moment, OSTree only supports managing syslinux; other
bootloader backends will follow.
Colin Walters [Fri, 5 Jul 2013 21:29:07 +0000 (17:29 -0400)]
deploy: Error out if we see usr/etc
This version of the code doesn't know what to do with new-model trees,
so just abort if we see that. We'll likely never care about upgrades
from 1.0 to 2.0.
Colin Walters [Fri, 5 Jul 2013 20:51:47 +0000 (16:51 -0400)]
core: Allow '.' in refspecs too
For version numbers.
Colin Walters [Fri, 5 Jul 2013 20:12:10 +0000 (16:12 -0400)]
Add "trivial-httpd" builtin, use it in tests
A simple HTTP server implementation is so few lines of code when one
is linking to libsoup anyways, so let's just have one here in ostree
that will be used for the test suite.
This allows us to run the archive tests that previously required
apache even in gnome-ostree.
Colin Walters [Tue, 2 Jul 2013 15:24:07 +0000 (11:24 -0400)]
tests: Pull from file:/// only works with archive-z right now
Colin Walters [Tue, 2 Jul 2013 02:35:54 +0000 (22:35 -0400)]
pull: Make fetcher work for file:/// URIs too
Even if very suboptimally, for now; we copy the files, then copy them
again.
The obvious long term plan is to merge pull-local and pull together,
but truly optimizing that requires the pull code to know how to use
the OstreeRepo APIs when operating on local repositories (as
pull-local does), rather than assuming the remote is an archive-z
fetched over HTTP.
Colin Walters [Mon, 1 Jul 2013 14:18:26 +0000 (10:18 -0400)]
Add support for deleting refs
The internal API will be used by admin, and "ostree refs --delete"
is handy for interactive management.
Colin Walters [Sat, 29 Jun 2013 18:51:08 +0000 (14:51 -0400)]
Add "refs" builtin
This is just useful to look at before pruning, etc.
Colin Walters [Sat, 29 Jun 2013 18:02:17 +0000 (14:02 -0400)]
Add a bit more testing for prune
Colin Walters [Sat, 29 Jun 2013 17:48:26 +0000 (13:48 -0400)]
Extract prune logic into an internal API
This will be used by ostree admin deploy.
Colin Walters [Sat, 29 Jun 2013 15:44:26 +0000 (11:44 -0400)]
pull-local: Support --remote argument
For offline upgrades, pull-local can now write the refs into a
specific remote, rather than using the local heads.
Colin Walters [Sat, 29 Jun 2013 15:42:33 +0000 (11:42 -0400)]
core: Add "refspec" which is remote:refname
This allows an unambiguous reference; otherwise, it was too easy to
have confusion between local heads and remotes.
Colin Walters [Sat, 29 Jun 2013 15:43:31 +0000 (11:43 -0400)]
gioutils: Many new utility functions
Reading symbolic links becomes a much more common thing now.
Colin Walters [Sun, 23 Jun 2013 21:56:14 +0000 (17:56 -0400)]
prepare-root: Only bind mount /home, /tmp, /root if they are directories
What we expect for new systems is for these to be symbolic links:
/home -> /sysroot/home
etc.
Colin Walters [Fri, 14 Jun 2013 23:45:40 +0000 (19:45 -0400)]
core: Port more callsites to gs_file_enumerator_iterate()
See previous commit.
Colin Walters [Fri, 14 Jun 2013 23:14:35 +0000 (19:14 -0400)]
core: Update libgsystem, port some uses of GFileEnumerator
This makes the code *so* much nicer.
Colin Walters [Sat, 8 Jun 2013 18:15:43 +0000 (14:15 -0400)]
pull-local: Fix race condition pointed out by Benjamin
We could drop into g_main_loop_run() after the worker
thread had called g_main_loop_quit().
Fix this by following the pattern suggested by Ryan of a while loop
around our termination condition, and g_main_context_iteration().
Colin Walters [Sat, 8 Jun 2013 16:58:44 +0000 (12:58 -0400)]
pull-local: Fix race condition
https://bugzilla.gnome.org/show_bug.cgi?id=701861
Colin Walters [Tue, 4 Jun 2013 17:18:36 +0000 (13:18 -0400)]
dracut: Add ostree-remount
Linux creates a copy of the soure mount flags when creating a bind
mount; if the source is read-only, then the bind mount is.
The problem is that systemd will remount the rootfs read/write, but
each mount (/home, /var etc.) will still be read-only. We need to
remount every bind mount except for /usr to read-write too.
This only "worked" with the old ostree-switch-root because it
effectively force mounted the rootfs read-write always, ignoring the
"ro" flag.